package com.ynny.librarysystemmanager.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {

    private Integer code;

    private String msg;

    private Object data;


    public static R ok(Object data) {
        return new R(200, "OK", data);
    }


    public static R fail(Integer code, String msg) {
        return new R(code, msg , null);
    }
}
